/**
 * 人脸登录相关API接口
 */

import request from './request'

/**
 * 人脸登录接口
 */
export const faceLogin = async (faceData: {
  faceImage: string
  faceToken?: string
}) => {
  return request.post('/health/user/v1/faceLogin', faceData, {
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

/**
 * 人脸注册接口
 */
export const faceRegister = async (faceData: {
  userId: string
  faceImage: string
  faceToken?: string
  faceFeature?: string
}) => {
  return request.post('/health/user/v1/faceRegister', faceData, {
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

/**
 * 检查用户是否已注册人脸
 */
export const checkFaceRegistered = async (userId: string) => {
  return request.get(`/health/user/v1/faceRegistered/${userId}`)
}

/**
 * 删除用户人脸数据
 */
export const deleteFaceData = async (userId: string) => {
  return request.delete(`/health/user/v1/faceData/${userId}`)
}
